package com.dongdongshop.controller;
import com.alibaba.dubbo.config.annotation.Reference;
import com.dongdongshop.data.Result;
import com.dongdongshop.em.ConstantEnum;
import com.dongdongshop.pojo.TbContent;
import com.dongdongshop.service.TbAddressService;
import com.dongdongshop.service.TbContentService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@Controller
@RequestMapping("content")
public class TbContentController{
    @Reference
    private TbContentService tbContentService;
    @Reference
    private TbAddressService tbAddressService;
    //有bug
    @RequestMapping("getContentInfo/{id}")
    @ResponseBody
    public Result toGetInfo(@PathVariable("id")Long id){
         List<TbContent> tbContentList =  tbContentService.selectByCid(id);
         return Result.build(ConstantEnum.SUCCESS).setResult(tbContentList);
    }
    @RequestMapping("toHome-index")
    public String toShow(){
        return "home-index";
    }



}
